
package study.Stream;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.function.Consumer;
import java.util.stream.Stream;

public class FoundStream {
    public FoundStream() {
    }

    public static void main(String[] args) {
        ArrayList<String> list = new ArrayList();
        Collections.addAll(list, new String[]{"a", "B", "c", "D", "E"});
        Stream<String> listSteam = list.stream();
        listSteam.forEach(new Consumer<String>() {
            public void accept(String string) {
                System.out.println(string);
            }
        });
        list.stream().forEach((string) -> System.out.println(string));
        Map<String, Integer> map = new HashMap();
        map.put("a", 1);
        map.put("b", 2);
        map.put("c", 3);
        map.put("d", 4);
        map.keySet().stream().forEach((string) -> System.out.println(string));
        map.values().stream().forEach((string) -> System.out.println(string));
        map.entrySet().stream().forEach((string) -> System.out.println(string));
        int[] ints = new int[]{1, 2, 3, 4, 5, 6};
        Arrays.stream(ints).forEach((integer) -> System.out.println(integer));
        String[] strings = new String[]{"a", "b", "c", "d", "e"};
        Arrays.stream(strings).forEach((string) -> System.out.println(string));
        Stream.of(1, 2, 3, 4).forEach((integer) -> System.out.println(integer));
        Stream.of("a", "b", "c", "d", "e").forEach((string) -> System.out.println(string));
        Stream.of(ints).forEach((integer) -> System.out.println(integer));
        Stream.of(strings).forEach((string) -> System.out.println(string));
    }
}
